<%@Page Language="C#" %>

<%

//SortedList alphabet = new SortedList();

//alphabet = CollectionsUtil.CreateCaseInsensitiveSortedList();

//alphabet.Add( "Z", "The Letter Z" );
//alphabet.Add( "A", "The Letter A" );
//alphabet.Add( "S", "The Letter S" );

//Response.Write("<h3>A sorted list</h3>");

//foreach( DictionaryEntry letter in alphabet )
//{
//	Response.Write( "<BR>" + letter.Key + " - " + letter.Value);
//}

Hashtable names = new Hashtable();

names.Add( "RA", "Richard Anderson" );
names.Add( "DS", "David Sussman" );
names.Add( "RH", "Rob Howard" );
names.Add( "AH", "Alex Homer" );

Response.Write("<h3>Unsorted list</h3>");

foreach( DictionaryEntry name in names )
{
	Response.Write( "<BR>" + name.Key + " - " + name.Value);
}


Response.Write("<h3>Sorted list</h3>");

// Create a sorted copy of the list 

SortedList sortedNameList = new SortedList( names );

foreach( DictionaryEntry name in sortedNameList )
{
	Response.Write( "<BR>" + name.Key + " - " + name.Value);
}

// Create a sorted copy of the list 

//foreach( string name in sortedNameList.GetValueList() )
//{
//	Response.Write( "<BR>" + name );
//}


%>
